package cn.buk.api.ctrip.Factory;

import com.thoughtworks.xstream.XStream;

/**
 * Created by yfdai on 15/4/29.
 */
public class BaseFactory {

    protected static final String HOTEL_XML_NAMESPACE = "http://www.opentravel.org/OTA/2003/05";

    public static XStream createXStream(boolean ignoreUnknownElements) {
        XStream xStream = new XStream();
        XStream.setupDefaultSecurity(xStream);

        // 设置允许解析的类
        xStream.allowTypesByWildcard(new String[]{
                "cn.buk.api.ctrip.dto.tbooking.*",
                "cn.buk.api.ctrip.dto.*"
        });

        if (ignoreUnknownElements) xStream.ignoreUnknownElements();

        return xStream;
    }

    protected static XStream createXStream() {
        return createXStream(false);
    }
}
